-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update xunit templates to xunit.v3 #50117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the xUnit templates to use xUnit v3 by replacing the xunit package references with xunit.v3 across all project templates and adding Microsoft.Testing.Platform configuration guidance.
Key Changes
- Updated package references from
xunit
version 2.9.3 toxunit.v3
version 3.0.0 - Added commented configuration options and documentation for Microsoft.Testing.Platform integration
- Applied changes consistently across C#, F#, and Visual Basic project templates
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
Company.TestProject1.csproj | Updated C# xUnit template with v3 package and Microsoft.Testing.Platform documentation |
Company.TestProject1.fsproj | Updated F# xUnit template with v3 package and Microsoft.Testing.Platform documentation |
Company.TestProject1.vbproj | Updated VB xUnit template with v3 package and Microsoft.Testing.Platform documentation |
...crosoft.DotNet.Common.ProjectTemplates.10.0/content/XUnit-FSharp/Company.TestProject1.fsproj
Outdated
Show resolved
Hide resolved
Is there any reason these templates shouldn't be exactly what we're shipping in |
What I'm saying here is: I like my templates a lot better than yours. Shipping them was not just a holdover waiting for you to update yours. |
...crosoft.DotNet.Common.ProjectTemplates.10.0/content/XUnit-CSharp/Company.TestProject1.csproj
Outdated
Show resolved
Hide resolved
...crosoft.DotNet.Common.ProjectTemplates.10.0/content/XUnit-CSharp/Company.TestProject1.csproj
Outdated
Show resolved
Hide resolved
@bradwilson Is it better now? Any other concerns you have with the current shape? Maybe we could add |
I would love for you to include a default |
I agree! |
We also ship templates for extension authors, but I'm guessing that's probably beyond scope for inclusion here (which means we'll still end up shipping our templates; that'll need to be true until net8 is out of support anyways, since these new templates are only going in the net10 SDK). |
For the {
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json"
} Along with this in the project file: <ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup It's applicable to all languages. |
Description
We would like to update templates for xUnit.net version 2, to version 3, because it is the current version of xUnit.net. We want to make this change now, and keep pushing newer versions of xunit 3 into the templates until the release of .NET. The update between v3 and v2 has potential to break users, which is why we want to do it now rather than later. The subsequent updates will be bug fixes.
Customer Impact
Users creating new test projects for xunit.net will use xunit.net v3, while previously they would use v2. Users are able to change the versions back to xunit v2 if they wish to stay on v2. Or they can migrate their other projects to v3 using this migration guide: https://xunit.net/docs/getting###started/v3/migration
Regression
No.
Risk
Low.
Users are able to easily revert their dependency versions to target xunit.net v2. Xunit.net v2 is not under active development as is rarely receiving new fixes, which is why we want to prefer v3.
Link the PR to the original issue and to the PR to main.
#50117
Note any packaging impact
No impact.
Note any ref pack impact.
No impact.
Fixes #45645